import request from '@/utils/request'

export const getDepartmentsAPI = () => {
  return request.get('/company/department')
}

export function getDepartmentDetailAPI(id) {
  return request({
    url: `/company/department/${id}`
  })
}

export const getManagerListAPI = () => {
  return request.get('/sys/user/simple')
}

export const addDepartmentAPI = (data) => {
  return request.post(
    '/company/department',
    data
  )
}

export const updateDepartDataAPI = (data) => {
  return request.put(
    `/company/department/${data.id}`,
    data
  )
}

export const delDepartmentAPI = (id) => {
  return request.delete(
    `/company/department/${id}`
  )
}

